<template>
  <div class="user_header">
    <div class="user_avatar">
      <img :src="userInfo.avatar" alt="头像" width="55" height="55">
      <div>
        <span>{{userInfo.nickName}}</span><br/>
        <img style="margin: 0;border-radius: 30%;width: 46px;" v-if="userInfo.partner"  :src="userInfo.partnerIcon" alt="等级" >
      </div>
    </div>
    <p class="user_set" @click="toSetting">个人中心&nbsp;&nbsp;&nbsp;&nbsp;></p>
  </div>
</template>

<script>
import bg_default from '@/assets/images/user_head_bg.png';
import { getLocalStorage } from '@/utils/local-storage';
import { userIndex } from '@/api/api';


export default {
  name: 'user-header',

  props: {
    userInfo: {
      type: Object,
      default: () => { }
    }
  },

  data () {
    return {
      background_image: bg_default
    };
  },

  activated () {
  },

  methods: {
    toSetting () {
      this.$router.push({ name: 'user-information' });
    }
  }
};
</script>

<style lang="scss" scoped>
.user_header {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user_set {
  font-size: 14px;
  color: #fff;
  background: rgb(233, 191, 3);
  padding-left: 12px;
  padding-right: 12px;
  line-height: 24px;
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.user_avatar {
  display: flex;
  align-items: center;
  font-size: 18px;
  font-weight: 700;

  img {
    border: 0;
    border-radius: 50%;
    margin-right: 12px;
    margin-left: 24px;
  }
}
</style>
